package com.zj.osm.view.map.line

import com.zj.osm.App
import com.zj.osm.entity.db.LineDao
import com.zj.osm.entity.greendao.Line
import com.zj.osm.entity.greendao.Point

/**
 * @author jiang zhu on 2019/10/30
 */
class LineActivityModel {

    private val daoSession = App.getInstances().daoSession

    fun getLine(lineId: Long): Line {
        return daoSession.lineDao.queryBuilder().where(LineDao.Properties.Id.eq(lineId)).unique()
    }


    fun getPoint1(line: Line): Point {
        return line.pointList[0]
    }

    fun getPoint2(line: Line): Point {
        return line.pointList[1]
    }


}